/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans.ejb;

import entities.Nflplayer;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author The Lunatics
 */
@Stateless
public class NflplayerFacade extends AbstractFacade<Nflplayer> {
    @PersistenceContext(unitName = "Touchdown308PU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public NflplayerFacade() {
        super(Nflplayer.class);
    }
    public Nflplayer getPlayerById(String s)
    {
        Query q = em.createNamedQuery("Nflplayer.findById");
        q.setParameter("id", Integer.parseInt(s));
        
        return (Nflplayer)q.getSingleResult();
    }
}
